<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GonzalesClaimsPendingForApprovalDetail.aspx.cs" Inherits="GonzalesClaimsPendingForApprovalDetail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="WebStyle.css" rel="stylesheet" type="text/css" />
    
    <link rel="stylesheet" href="js/windowfiles/dhtmlwindow.css" type="text/css" />
    <script type="text/javascript" src="js/windowfiles/dhtmlwindow.js">

    /***********************************************
    * DHTML Window Widget-  Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for legal use.
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    </script>

    <link rel="stylesheet" href="js/modalfiles/modal.css" type="text/css" />
    <script type="text/javascript" src="js/modalfiles/modal.js"></script>
    <script type="text/javascript" src="js/modaltools.js"></script>    

<script language="javascript" type="text/javascript" src="js/specialgl.js"></script>
<script language="javascript" type="text/javascript">

    function RejectValidation(ConfirmationMessage) {
        var valid = true;
        
        if (confirm(ConfirmationMessage)) {
            
            var msg = "";
            var TotalReject = 0;
            var NoRemarks = false;
            
            for (var x = 0; x < document.forms[0].elements.length; x++) {
                if ( document.forms[0].elements[x].name.indexOf("_ApproverState") > 0) {
                    if (!document.forms[0].elements[x].checked) {
                        TotalReject++;
                        
                        var RowID = document.forms[0].elements[x].name.substring (0, 36);
                        if (document.getElementById(RowID + "_ApproverRemarks").value == "") {
                            NoRemarks = true;
                        }
                    }
                }
            }

            if (NoRemarks) {
                valid = false;
                msg += ItemRejectAlert;
            }
            
            if (TotalReject == 0) {
                valid = false;
                msg += ItemRejectWarning;
            }
            
            if (!valid) alert(msg);
        
        } else {
            valid = false;
        }
        
        return valid;
    }
    

</script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table width="100%" border="0" cellspacing="1" cellpadding="8">
        <tr>
          <td class="PageTitle"><asp:Label ID="Label_PageTitle" Text='Approver' runat="server" />          
</td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td width="20%" valign="top"><asp:Label CssClass="FormTitle" ID="Label_Information" runat="server" Text='Pending' /></td>                                
                <td width="3" class="VerticalDivider">&nbsp;</td>
                <td><asp:Label CssClass="NormalBodyText" ID="Label_Remarks" runat="server" Text='Find an existing claim to review. You may create a new claim by copying an existing one.' /></td>
                </tr>
                   <tr>
                    <td colspan="3">&nbsp;</td>
                   </tr>
                   <tr>
                    <td colspan="3" valign="top"><asp:Table CellPadding="5" CellSpacing="0" ID="Table_MessageBox" Width="100%" runat="server" Visible="false">
                  <asp:TableRow>
                    <asp:TableCell CssClass="ErrorBox" ></asp:TableCell>
                  </asp:TableRow>
                </asp:Table></td>
            </tr>
              <tr>
                <td colspan="3" width="90%" valign="top"><table width="100%" border="0" cellpadding="5" cellspacing="0" class="FormBorder">
                  <tr>
                    <td colspan="4" align="right" class="FormLineItemAlt">&nbsp;
                       <asp:ImageButton ID="ImageButton_Cancel" runat="server" ImageUrl="~/img/popcalendar/close.gif"
                            OnClick="ImageButton_Cancel_Click" /></td>
                  </tr>
                  <tr>
                    <td width="140" class="FormLineItem"><asp:Label CssClass="FormField" ID="Label_EmployeeName" runat="server" Text='Employee Name' /></td>
                    <td width="39%" class="FormLineItem"><asp:Label CssClass="NormalBodyText" ID="LabelValue_EmployeeName" runat="server" />                    
<asp:ImageButton ID="ImageButton_Mail" runat="server" ImageUrl="img/ico_mail.gif" /></td>
                    <td width="140" class="FormLineItem"><asp:Label CssClass="FormField" ID="Label_Category" runat="server" Text='Category:' /></td>
                    <td width="29%" class="FormLineItem"><asp:Label CssClass="NormalBodyText" ID="LabelValue_Category" runat="server" />                    
</td>
                  </tr>
                  <tr>
                    <td class="FormLineItemAlt"><asp:Label CssClass="FormField" ID="Label_EmployeeNo" runat="server" Text='Employee No' /></td>
                    <td class="FormLineItemAlt"><asp:Label CssClass="NormalBodyText" ID="LabelValue_EmployeeNo" runat="server" /></td>
                    <td class="FormLineItemAlt"><asp:Label CssClass="FormField" ID="Label_CreationDate" runat="server" Text='Creation Date' /></td>
                    <td class="FormLineItemAlt"><asp:Label CssClass="NormalBodyText" ID="LabelValue_CreationDate" runat="server" /></td>
                  </tr>
                  <tr>
                    <td class="FormLineItem" style="height: 29px"><asp:Label CssClass="FormField" ID="Label_ClaimNum" runat="server" Text='Claim Number' /></td>
                    <td class="FormLineItem" style="height: 29px"><asp:Label CssClass="NormalBodyText" ID="LabelValue_ClaimNo" runat="server" /></td>
                    <td class="FormLineItem" style="height: 29px"><asp:Label CssClass="FormField" ID="Label_SubmissionDate" runat="server" Text='Submission Date' /></td>
                    <td class="FormLineItem" style="height: 29px"><asp:Label CssClass="NormalBodyText" ID="LabelValue_SubmissionDate" runat="server" /></td>
                  </tr>
                  <tr>
                    <td class="FormLineItemAlt"><asp:Label CssClass="FormField" ID="Label_Purpose" runat="server" Text='Purpose' /></td>
                    <td class="FormLineItemAlt"><asp:Label CssClass="NormalBodyText" ID="LabelValue_Purpose" runat="server" /></td>
                    <td class="FormLineItemAlt"><asp:Label CssClass="FormField" ID="Label_ProfitCenter" runat="server" Text='Profit Center' /></td>
                    <td class="FormLineItemAlt"><asp:Label CssClass="NormalBodyText" ID="LabelValue_ProfitCenter" runat="server" /></td>
                  </tr>
                  <tr>
                    <td class="FormLineItem"><asp:Label CssClass="FormField" ID="Label_claimPeriod" runat="server" Text='Claim Period:' /></td>
                    <td class="FormLineItem" colspan="3"><asp:Label CssClass="NormalBodyText" ID="LabelValue_ClaimPeriod" runat="server" /></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td width="100%" colspan="3" valign="top"><asp:Label CssClass="Greeting" ID="Label_Instruction" runat="server" Text='' />
<br />
                  <table width="100%" border="0" cellpadding="2" cellspacing="0" class="FormBorder">
                    <tr>
                      <td align="right" class="TableResultCriteriaBar"><asp:DropDownList CssClass="FormDropDown" ID="DropDownList_SortBy" runat="server" OnSelectedIndexChanged="DropDownList_SortBy_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList></td>
                    </tr>
                    <tr>
                      <td>
                    
                    <asp:Table ID="Table_ClaimDetailGrid" runat="server" Width="100%" CellPadding="2" CellSpacing="1" CssClass="FormBorder">                    </asp:Table>                    </td>
                    </tr>
                  </table>
              <br />
                    <table border="0" cellpadding="5" cellspacing="1" class="FormBorder" width="500">
                  <tr>
                            <td class="GridViewItem">
                                <asp:Label ID="Label_TotalAmount" runat="server" CssClass="FormField" Text="Total Amount in Local Currency:"></asp:Label></td>
                            <td align="right" class="GridViewItem" style="width: 200px">
                                <asp:Label ID="Label_TotalLocalAmount" Font-Size="12px" runat="server"></asp:Label></td>
                      </tr>
                      <tr>
                    <td class="GridViewItem"><span class="GridViewItem" style="height: 23px">
                      <asp:Label ID="Label1" runat="server" Text='Less Personal Expenses:' CssClass="FormField" />                      
</span></td>
                    <td align="right" class="GridViewItem" style="width: 200px"><span class="GridViewItem" style="width: 200px">
                      <asp:Label ID="LabelValue_TotalPersonalExpenses" Font-Size="12px" runat="server"></asp:Label>
                    </span></td>
                  </tr>
                  <tr>
                    <td class="GridViewItem"><span class="GridViewItem" style="height: 23px">
                      <asp:Label ID="Label_TotalAmountLessPaid" runat="server" Text='Less card transactions:' CssClass="FormField" />                      
</span></td>
                    <td align="right" class="GridViewItem" style="width: 200px"><span class="GridViewItem" style="width: 200px">
                      <asp:Label ID="Label_TotalAmountAlreadyPaid" Font-Size="12px" runat="server"></asp:Label>
                    </span></td>
                  </tr>
                  <tr>
                    <td class="GridViewItem"><span class="GridViewItem" style="height: 23px">
                      <asp:Label CssClass="FormField" ID="Label_OwningEmployee" runat="server" Text='Owing to/from employee' />                      
</span></td>
                    <td align="right" class="GridViewItem" style="width: 200px"><span class="GridViewItem" style="width: 200px">
                      <asp:Label ID="Label_Owning"  Font-Size="12px" runat="server"></asp:Label>
                    </span></td>
                  </tr>
                  
                        <tr>
                            <td class="GridViewItem" colspan="2">                           
                            <asp:Table CellSpacing="2" CellPadding="2" runat="server" ID="Table_ChequeInfo">
                            <asp:TableRow>
                            	<asp:TableCell><asp:Label CssClass="FormField" ID="Label_ChequeNo" runat="server" Text="Cheque No.:" /></asp:TableCell>
                                <asp:TableCell><asp:Label ID="LabelValue_ChequeNo" Font-Size="12px" runat="server"></asp:Label></asp:TableCell>
                                <asp:TableCell><asp:Label CssClass="FormField" ID="Label_IssuedBank" runat="server" Text='Issued Bank:' /></asp:TableCell>
                                <asp:TableCell><asp:Label ID="LabelValue_IssuedBank" Font-Size="12px" runat="server"></asp:Label></asp:TableCell>
                            </asp:TableRow>                                                        
                            </asp:Table>                            </td>
                        </tr>
                        <tr>
                            <td class="GridViewItem" colspan="2">
                                <table border="0" cellpadding="2" cellspacing="1">
                                    <tr>
                                        <td><asp:Button id="Button_FileManager" runat="server" Text="Supporting Documents" CssClass="FormButton"></asp:Button></td>
                                        <td>
                                            <asp:Button CssClass="FormButton" ID="Button_Approve" runat="server" Text="Approve" OnClick="Button_Approve_Click" /></td>
                                        <td>
                                            <asp:Button CssClass="FormButton" ID="Button_Reject" runat="server" Text="Reject" OnClick="Button_Reject_Click" /></td>
                                            <td><asp:Button CssClass="FormButton" ID="Button_PrinterFriendly" runat="server" Text="Print Preview" /></td>
                                            <td><asp:Button CssClass="FormButton" ID="Button_PrinterFriendlyNameList" runat="server" Text="Print Preview (Participant Lists)" /></td>
                                    </tr>
                                </table>                            </td>
                        </tr>
                    </table>
          <br />                    </td>
              </tr>
              
          </table></td>
        </tr>
      </table>    
    </div>
    </form>
    
    <script language="javascript" type="text/javascript">
        
        for (var x = 0; x < document.forms[0].elements.length; x++) {
                
            if ( document.forms[0].elements[x].name.indexOf("_HiddenGLCode") > 0) {
 
                var RowID = document.forms[0].elements[x].name.substring (0, 36);
                var GLCode = document.forms[0].elements[x].value;
                var SelectedIndex = -1;
                
                for (var y = 0; y < special_glinfo.length; y++) {
                    if (special_glinfo[y] == GLCode) {
                        // having pop out
                        document.getElementById(RowID + "_HiddenPopOut").value = "1";
                        if(FirstTimeLoad == 0)
                            document.getElementById(RowID + "_ApproverState").checked = false;
                        SelectedIndex = y;
                        break;
                    }                    
                }   // y
                
                if (SelectedIndex == -1) {
                    // hide it
                    document.getElementById(RowID + "_ImageButtonDetail").style.display = 'none';
                }

            }
        }// x    
    
    
    </script>
</body>
</html>
